#include"tsubtitle.h"

ostream &operator<<(ostream &os, const TSubtitle &s)
{
	os << SUBT_FIRST;
	os << s.id << SUBT_SEPARATION << s.text;
	os << SUBT_LAST;

	return os;
}

TSubtitle::TSubtitle(void)
{
	id = -1;
	text = "SUBTITLE ERROR";
}

TSubtitle::TSubtitle(int id)
{
	this->id = id;
	text = "";
}


TSubtitle::TSubtitle(int id, string text)
{
	this->id = id;
	this->text = text;
}


TSubtitle::TSubtitle(const TSubtitle &s)
{
	this->text = s.text;
}


TSubtitle::~TSubtitle(void)
{
}


TSubtitle &TSubtitle::operator=(const TSubtitle &s)
{
	if(this != &s)
	{
		id = s.id;
		text = s.text;
	}

	return (*this);
}

void TSubtitle::SetText(string new_text)
{
	text = new_text;
}

bool TSubtitle::operator==(const TSubtitle &s) const
{
	return  text == s.text;
}

bool TSubtitle::operator!=(const TSubtitle &s) const
{
	return  text != s.text;
}

int TSubtitle::GetID(void) const
{
	return id;
}



